
package com.yuke.cloud.service.api.uac.service;


import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;
import com.yuke.cloud.common.security.feign.OAuth2FeignAutoConfiguration;
import com.yuke.cloud.common.util.wrapper.Wrapper;
import com.yuke.cloud.service.api.smc.dto.ShopInfoDto;
import com.yuke.cloud.service.api.uac.dto.*;
import com.yuke.cloud.service.api.uac.service.hystrix.UacUserFeignApiHystrix;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * The interface Uac user feign api.
 *
 * @author
 */
@FeignClient(value = "yuke-cloud-service-uac", configuration = OAuth2FeignAutoConfiguration.class,
        fallback = UacUserFeignApiHystrix.class, path = "${yuke.feign-path-uac}")
public interface UacUserFeignApi {

    /**
     * 根据仓库所在的组织ID,获取仓库管理员用户.
     *
     * @param groupId the warehouse group id
     * @return the list of warehouse admin users
     */
    @GetMapping(value = "/api/uac/user/getWarehouseAdmins")
    Wrapper<List<WarehouseAdminUserDto>> getWarehouseAdmins(@RequestParam("groupId") Long groupId);

    @PostMapping(value = "/api/uac/user/{userId}")
    Wrapper<UserInfoDto> getUserInfoByUserId(@ApiParam(name = "userId", value = "用户id") @PathVariable(value = "userId") Long userId);

    @PostMapping(value = "/api/uac/user/getUserInfoByIds")
    Wrapper<List<UserInfoDto>> getUserInfoByUserIds(@ApiParam(name = "userIds", value = "用户id") @RequestBody List<Long> userIds);

    @PostMapping(value = "/api/uac/user/modifyUserType")
    Wrapper modifyUserType(@ApiParam(name = "modifyUserTypeDto", value = "用户类型修改信息") @RequestBody ModifyUserTypeDto modifyUserTypeDto);

    /**
     * 根据用户ID获取用户登录设备token.
     *
     * @param userId the 用户ID
     * @return the UserLoginInfoDto
     */
    @GetMapping(value = "/api/uac/user/userDeviceToken/{userId}")
    Wrapper<List<UserLoginInfoDto>> getUserDeviceToken(@PathVariable("userId") Long userId);

    @PostMapping(value = "/api/uac/user/getGroupInfoByGroupId")
    Wrapper<GroupInfoDto> getGroupInfoByGroupId(@RequestParam("groupId") Long groupId);

    @PostMapping(value = "/api/uac/user/updateUserGroup")
    Wrapper updateUserGroup(@RequestParam("userId") Long userId, @RequestParam("groupId") Long groupId);

    @PostMapping(value = "/api/uac/user/updateAmountBalance")
    Wrapper<Integer> updateAmountBalance(@RequestBody UserInfoDto userInfoDto);

    @GetMapping(value = "/api/uac/user/getUserInfoDto")
    Wrapper<List<UserInfoDto>> getUserInfoDto(@RequestParam("loginName") String loginName);

    @PostMapping(value = "/api/uac/user/getUserPageByUserIds")
    Wrapper<PageInfo<UserInfoDto>> getUserPageByUserIds(@RequestBody JSONObject jsonObject);

    @PostMapping(value = "/api/uac/user/autoRegisterUserAndShop")
    Integer autoRegisterUserAndShop(@RequestBody JSONObject jsonObject);

    @PostMapping(value = "/api/uac/employee/selectEmployInfo")
    Wrapper<List<UserInfoDto>> selectEmployInfo(@RequestBody AccEmployeeInfoDto accEmployeeInfoDto);

    @PostMapping(value = "/api/uac/employee/countWorkDay")
    List<Map> countWorkDay(@RequestBody Map countMap);

    @PostMapping(value = "/api/uac/acc/findSupplierById")
    SupplierApiDto findSupplierById(@RequestParam("supplierId") Long supplierId);

    @PostMapping(value = "/api/uac/acc/findSupplierByIds")
    List<SupplierApiDto> findSupplierByIds(@RequestBody List<Long> Ids);

    @PostMapping(value = "/api/uac/acc/updateSupplierById")
    Integer updateSupplierById (@RequestBody SupplierApiDto supplierApiDto );

    @PostMapping(value = "/api/uac/acc/saveUserDeliveryAddress")
    Integer saveUserDeliveryAddress(@RequestBody ShopInfoDto shopInfoDto);
}
